// Header Protection
#ifndef _EVENTARG_H_
#define _EVENTARG_H_

// Include Files
#include "Definitions.h"

// Namespace
namespace IE
{
	/////////////////////////////////////////////////////////////////////////////////
	// A base class from which to derive in order to pass data with a raised event.
	class CEventArg
	{
	public:     // methods
		inline CEventArg() : m_uRefCount(0) { }

		// Add a reference to the event argument.
		inline void AddRef() { ++m_uRefCount; }

		// Remove a reference from the event arguments, delete them if there are 
		//     no more references.
		inline void Release() { if( --m_uRefCount == 0 ) delete this; }

	private:    // methods
		inline virtual ~CEventArg() { }

	private:    // data
		uint_t m_uRefCount;

	private:    // dummy definitions
		CEventArg( CEventArg const & );
		CEventArg &operator =( CEventArg const & );
	};
}

// Header Protection
#endif // _EVENTARG_H_
